package byj.com.meishi.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.util.SparseArray;

import java.util.List;

/**
 * Created by Administrator on 2016/9/19 0019.
 */
public class TabFindFragmentAdapter extends FragmentPagerAdapter{
    private SparseArray<Fragment> listFragment;
    private List<String> listTitle;

    public TabFindFragmentAdapter(FragmentManager fm,SparseArray<Fragment> list,List<String> listtitle){
        super(fm);
        listFragment=list;
        listTitle=listtitle;

    }
    @Override
    public Fragment getItem(int position) {
        return listFragment.get(position);
    }

    @Override
    public int getCount() {
        return listTitle.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return listTitle.get(position % listTitle.size());
    }
}
